<?php $this->load->view('inc/header2');?>

<div style="width: 600px;margin: 0px auto;margin-top: 30px;">

    <div style="text-align: center;margin-bottom: 20px;">
    	<a href="<?php echo site_url();?>"><?php html_img('logo1.jpg');?></a>
    </div>
    
	<form id="frm-login" action="<?php echo site_url('c=member&m=regist_do');?>"
		submitbefor="frm_login_befor"
	>
	<input type="hidden" name="invitor" value="<?php echo fd('invitor');?>"/>
	<table class="tbl-frm-1">
		<tr>
			<th width="60">昵 称：</th>
			<td>
				<input class="inp" type="text" name="nname"/>
				<span id="tip-nickname" class="tip">来给自己起个优雅而响亮的名字吧！</span>
			</td>
		</tr>
		<tr>
			<th>邮 箱：</th>
			<td>
				<input class="inp" type="text" name="email"/>
				<span id="tip-email" class="tip">据说地球人都有邮箱的！</span>
			</td>
		</tr>
		<tr>
			<th>密 码：</th>
			<td>
				<input class="inp" type="password" name="upass"/>
				<span id="tip-pass" class="tip">密码由6~18位的英文，下划线或数字组成的哦！</span>
			</td>
		</tr>
		<tr>
			<th>性 别：</th>
			<td>
				<label><input name="sex" type="radio" value="male"/>传统男</label>&nbsp;
				<label><input name="sex" type="radio" value="female"/>传统女</label>&nbsp;
				<label><input name="sex" type="radio" value="ycmale"/>宇春</label>&nbsp;
				<label><input name="sex" type="radio" value="jjmale"/>俊基</label>
				<span id="tip-sex" class="tip">先就这么多了，您先将就着个用吧 ^^!!！</span>
			</td>
		</tr>
		<tr>
			<th>&nbsp;</th>
			<td class="p1">
				<input id="btn-login_do" class="btn-ajax-submit btn-3" frmid="frm-login" type="button" />
			</td>
		</tr>
	</table>
	</form>
	
</div>


<script>
function frm_login_befor($frm){

	$frm.find('.c1').removeClass('c1');
	
	var nickname = $frm.find('input[name=nname]').val().trim();
	if(nickname.length == 0){
		$('#tip-nickname').addClass('c1').html('').html('无名氏最不可爱了！');	
	} else{
		$('#tip-nickname').html('');	
	}

	var email = $frm.find('input[name=email]').val().trim();
	if(email.length == 0){
		$('#tip-email').addClass('c1').html('').html('地球人们的邮箱没有为空的啦^^！');
	}else if(email.length != 0 && !isEmail(email)){
		$('#tip-email').addClass('c1').html('').html('好奇怪的邮箱哦，哥哥这是刚打火星来的么！');	
	}else{
		$('#tip-email').html('');	
	} 

	var password = $frm.find('input[name=upass]').val().trim();
	if(password.length == 0){
		$('#tip-pass').addClass('c1').html('').html('密码不能为空^^！');
	}else if(password.length != 0 && !isUpass(password)){
		$('#tip-pass').addClass('c1').html('').html('错误 的格式！');	
	}else{
		$('#tip-pass').html('');	
	} 
	
	var sex = $frm.find('input[name=sex]:checked').val();
	if(typeof sex == 'undefined'){
		$('#tip-sex').addClass('c1').html('').html('以后再为您定制咋样！');
	}else{
		$('#tip-sex').html('');	
	}

	if($frm.find('.c1').size()>0) return false;
	
	return true;
}

$(function(){
	$('#frm-login').keyup(function(e){
		if(e.which == 13){
			$('#btn-login_do').click();
		}
	});

	ajaxinit();
});

</script>

<?php $this->load->view('inc/footer1');?>